package com.fwtai.api;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * 用户余额收入访问数据库
 * @作者 李宇鹏
 * @版本 v1.0
 * @创建时间 2023-02-14 16:57:10
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class ApiUserBalanceIncomeDao{

  private final DaoHandle dao;

  public ApiUserBalanceIncomeDao(final DaoHandle dao){
    this.dao = dao;
  }

  public int add(final PageFormData formData){
    return dao.execute("api_user_balance_income.add",formData);
  }

  public Long queryExistById(final long user_id){
    return dao.queryForLong("api_user_balance_income.queryExistById",user_id);
  }

  public int edit(final PageFormData formData){
    return dao.execute("api_user_balance_income.edit",formData);
  }

  public HashMap<String,Object> queryById(final long user_id){//当是long类型时就不能传null空值,否则报空指针
    return dao.queryForHashMap("api_user_balance_income.queryById",user_id);
  }

  public int delById(final long user_id){//当是long类型时就不能传null空值,否则报空指针
    return dao.execute("api_user_balance_income.delById",user_id);
  }

  public int delByKeys(final Long[] list){
    return dao.execute("api_user_balance_income.delByKeys",list);
  }

  public List<HashMap<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListHashMap("api_user_balance_income.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("api_user_balance_income.listTotal",formData);
  }
}